﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Jbe.TestSuite.Infrastructure.Interface;
using Jbe.Composite.Extensions;
using Jbe.TestSuite.TestDevices.SignalVisualizer.Applications;

namespace Jbe.TestSuite.TestDevices.SignalVisualizer.Presentation
{
    /// <summary>
    /// Interaction logic for VisualizerView.xaml
    /// </summary>
    public partial class VisualizerView : UserControl, IVisualizerView
    {
        public VisualizerView()
        {
            InitializeComponent();
        }


        // INFO: In this case I believe the code behind is better than the logic in presentation model.
        private void ResetButtonClick(object sender, RoutedEventArgs e)
        {
            signalControl.ClearValue(SignalControl.ScaleXProperty);
            signalControl.ClearValue(SignalControl.ScaleYProperty);
        }

        public void AddSample(object device, double amplitude, double relativeTime)
        {
            signalControl.AddSample(device, relativeTime, amplitude);
        }
    }
}
